{yun:}include file="$wapstyle/member/cheader.htm"{/yun}
<link rel="stylesheet" href="{yun:}$wap_style{/yun}/js/mui/css/mui.picker.min.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
<link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/style.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
<script src="{yun:}$wap_style{/yun}/js/compress.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>

<script type="text/javascript">
    (function() {
        var num = '{yun:}$nopayorder{/yun}';

        if(parseInt(num) > 0) {
            layer.open({
                content: '您还有{yun:}$nopayorder{/yun}个订单未付款，是否继续充值！',
                btn: ['去付款', '继续充值'],
                shadeClose: false,
                yes: function() {
                    setTimeout(function() {
                        location.href = 'index.php?c=paylog';
                    }, 0);
                }
            });
        }

    })()

    var integral = '{yun:}$statis.integral{/yun}';
    var pro = '{yun:}$config.integral_proportion{/yun}';
    var min_integral = '{yun:}$config.integral_min_recharge{/yun}'; //最低充值积分
    var jifen = '{yun:}$config.integral_pricename{/yun}';
    var integralclass = [];
    '{yun:}foreach from=$integralclass_index item=v{/yun}'
    integralclass.push({
        id: '{yun:}$v{/yun}',
        integral: '{yun:}$integralclass_name[$v]{/yun}',
        discount: '{yun:}$integralclass_discount[$v]{/yun}'
    })
    '{yun:}/foreach{/yun}'
</script>
<div id="app" class="mui-views">
    <div class="mui-view">
        <div class="mui-pages"></div>
    </div>
</div>
<!--页面主结构结束-->
<!--单页面开始-->
<div id="main" class="mui-page">
    <!--页面主内容区开始-->
    <div class="mui-page-content">
        <div class="mui-scroll-wrapper">
            <div class="mui-scroll">
                <div class="yun_com_msg">
                    当前{yun:}$config.integral_pricename{/yun}兑换比为1元={yun:}$config.integral_proportion{/yun}{yun:}$config.integral_priceunit{/yun}{yun:}$config.integral_pricename{/yun}{yun:}if $config.integral_min_recharge>0{/yun}，单次最低充值{yun:}$config.integral_min_recharge{/yun}{yun:}$config.integral_pricename{/yun}。{yun:}/if{/yun}
                </div>

                <div class="pay_choice_box">

                    <form action="index.php?c=dingdan" method="post" onsubmit="return integral_form();" id="paymentform">

                        <ul class="pay_choice" id="integral_num">
                            {yun:}foreach from=$integralclass_index item=v key=k{/yun}
                            <li {yun:}if $k==0{/yun}class="pay_choice_cur" {yun:}/if{/yun} data-id="{yun:}$v{/yun}" data-integral="{yun:}$integralclass_name[$v]{/yun}" data-discount="{yun:}$integralclass_discount[$v]{/yun}"><span class=""><i class="pay_choice_n">{yun:}$integralclass_name[$v]{/yun}</i>{yun:}$config.integral_pricename{/yun}{yun:}if $integralclass_discount[$v] gt 0{/yun}<em class="pay_choice_zk">{yun:}$integralclass_discount[$v]{/yun}折</em>{yun:}/if{/yun}</span></li>

                            {yun:}/foreach{/yun}
                            <li data-integral="0"><span class=""><i class="pay_choice_n">自定义</i>{yun:}$config.integral_pricename{/yun}</span></li>
                        </ul>

                        <div class="pay_xymoney defined" style="display: none;">
                            <span class="pay_xymoney_name">自定义{yun:}$config.integral_pricename{/yun}</span>
                            <input type="text" value="" class="pay_xymoney_text" placeholder="输入要充值的{yun:}$config.integral_pricename{/yun}" id="user_defined" onkeyup="checkIntegralNum();" onBlur="autointegral();" oninput="myFunction(this)" maxlength="6">
                        </div>

                        <div class="pay_xymoney">
                            <span class="pay_xymoney_name">所需金额</span>
                            <div class="pay_xymoney_t"><em class="pay_xymoney_t_n"><span id="price">{yun:}if $integralclass_discount[$integralclass_index[0]] gt 0{/yun}{yun:}$integralclass_name[$integralclass_index[0]]/$config.integral_proportion*$integralclass_discount[$integralclass_index[0]]/100{/yun}{yun:}else{/yun}{yun:}$integralclass_name[$integralclass_index[0]]/$config.integral_proportion{/yun}{yun:}/if{/yun}</span></em> 元</div>
                        </div>
                        {yun:}if $coupons{/yun}
                        <div class="pay_xymoney" id="div_coupon">
                            <span class="pay_xymoney_name">优惠券</span>
                            <a href="#couponhtml">
                                <div class="pay_xymoney_t" id="couponshow">请选择</div>
                            </a>
                            <input type="hidden" id="coupon" name="coupon" value="">
                        </div>
                        {yun:}/if{/yun}

                        <div class="member_set_meal_fk_fbox mt10">
                            {yun:}if $config.wxpay==1{/yun}

                            <div class="member_set_meal_fk_fs member_set_meal_fk_fs_wx" onclick="paycheck('wxpay');">
                                <i class="wxpay member_set_meal_fk_xz"></i>微信支付
                            </div>
                            {yun:}/if{/yun} {yun:}if $config.alipay==1{/yun}
                            <div class="member_set_meal_fk_fs member_set_meal_fk_fs_zfb" onclick="paycheck('alipay');">
                                <i class="alipay member_set_meal_fk_xz"></i>支付宝
                            </div>

                            {yun:}/if{/yun} {yun:}if $config.bank==1 && $banks{/yun}
                            <div class="spread_box_more" id="spreadpaymore">其他支付方式</div>
                            <div class="member_set_meal_fk_fs member_set_meal_fk_fs_yl" id="spreadotherpay" onclick="paycheck('bank');" style="display:none">
                                <i class="bank member_set_meal_fk_xz" id="switchbank"></i>银行汇款
                            </div>
                            <div class="paybank item" id="spreadpaybank" style="display: none;">
                                <div class="paybank_tip"><span class="com_remind">汇款前请仔细核对银行帐号</span></div>

                                <div class="admin_note2">
                                    <div class="my_table_msg">
                                        {yun:}if is_array($banks){/yun} {yun:}foreach item=blist from=$banks{/yun}
                                        <div class="pay_bank_list">
                                            <div class="">{yun:}$blist.bank_name{/yun}</div>
                                            <div class="">{yun:}$blist.name{/yun}</div>
                                            <div class="">{yun:}$blist.bank_number{/yun}</div>
                                            <div class="">{yun:}$blist.bank_address{/yun}</div>
                                        </div>
                                        {yun:}/foreach{/yun} {yun:}else{/yun}
                                        <div class="wap_member_no">暂未添加银行</div>
                                        {yun:}/if{/yun}
                                    </div>

                                    <div class="paybank_tip">填写汇款凭证：</div>
                                    <div class="my_table_msg">
                                        <div class="paybank_hk_list">
                                            <div class="paybank_name">汇款银行</div>
                                            <div class="">
                                                <input type="text" id="bank_name" name="bank_name" class="paybank_hk_text" value="" placeholder="如：中国银行+沭阳开发区支行" />
                                            </div>
                                        </div>

                                        <div class="paybank_hk_list">
                                            <div class="paybank_name">汇入账号</div>
                                            <div class=""><input type="text" id="bank_number" name="bank_number" class="paybank_hk_text" onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" value="" /></div>
                                        </div>

                                        <div class="paybank_hk_list">
                                            <div class="paybank_name">汇款金额</div>
                                            <div class=""><input type="text" id="bank_price" name="bank_price" class="paybank_hk_text" value="{yun:}if $integralclass_discount[$integralclass_index[0]] gt 0{/yun}{yun:}$integralclass_name[$integralclass_index[0]]/$config.integral_proportion*$integralclass_discount[$integralclass_index[0]]/100{/yun}{yun:}else{/yun}{yun:}$integralclass_name[$integralclass_index[0]]/$config.integral_proportion{/yun}{yun:}/if{/yun}" /></div>
                                        </div>

                                        <div class="paybank_hk_list">
                                            <div class="paybank_name">汇款时间</div>
                                            <div class=""><button id='banktimePicker' data-options='{"type":"date"}' style="border:none;">请选择汇款时间</button>
                                                <input type="hidden" id="bank_time" name="bank_time" /></div>
                                        </div>

                                        <div class="paybank_hk_list">
                                            <div class="paybank_name">汇款单</div>
                                            <div class="" style="text-align:right">
                                            	
                                            	<span class="once_cont_wate_list_photo_pic" id="previewshow" style="display: none;"> <img id="previewimg" width="35" height="35"></span>
                                                	<div class="paybank_hk_file_box">
					                                    <i class="paybank_hk_file_icon"></i> 上传汇款单
					                                	<input type="file" name="pic" id="pic" onchange="previewImage(this,'preview')" accept="image/*" class="paybank_hk_file" />
					                                	<input type='hidden' name='preview' value='' id='preview'>
					                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            {yun:}/if{/yun}
                        </div>
                        <input type="hidden" value="" id="paytype" name="paytype" />
                        <input type="hidden" value="{yun:}if $integralclass_discount[$integralclass_index[0]] gt 0{/yun}{yun:}$integralclass_name[$integralclass_index[0]]/$config.integral_proportion*$integralclass_discount[$integralclass_index[0]]/100{/yun}{yun:}else{/yun}{yun:}$integralclass_name[$integralclass_index[0]]/$config.integral_proportion{/yun}{yun:}/if{/yun}" id="order_price" name="price" />
                        <input type="hidden" value="{yun:}$integralclass_name[$integralclass_index[0]]{/yun}" id="integral_int" name="price_int" />
                        <input type="hidden" id="integralid" name="integralid" value="{yun:}$integralclass_index[0]{/yun}" /> {yun:}if $config.wxpay==1 || $config.alipay==1 || ($config.bank==1 && $banks){/yun}
                        <div class="member_set_meal_fk_zf">
                            <input type="submit" class="member_set_meal_fk_zf_bth" value="确认支付">
                        </div>
                        {yun:}else{/yun}
                         <div class="pay_zfgb_tip">
                            <span>网站已关闭支付功能，请联系管理员！</span>
                        </div>
                        {yun:}/if{/yun}
                    </form>
                </div>
            </div>

        </div>
    </div>
    <!--页面主内容区结束-->
</div>
<!--单页面结束-->
<div id="couponhtml" class="mui-page">
    <div class="mui-page-content">
        <div class="mui-scroll-wrapper">
            <div class="mui-scroll">
                <div class="mui-card">
                    <div class="mui-input-row mui-radio mui-left">
                        <label>暂不使用</label>
                        <input name="coupon" type="radio" id="coupon0" value="0">
                        <input type="hidden" id="0" value="0">
                    </div>
                    {yun:}foreach from=$coupons item=clist{/yun}
                    <div class="mui-input-row mui-radio mui-left">
                        <label>{yun:}$clist.coupon_name{/yun}{yun:}if $clist.coupon_scope{/yun}(满{yun:}$clist.coupon_scope{/yun}元可使用) {yun:}/if{/yun}</label>
                        <input name="coupon" type="radio" id="coupon{yun:}$clist.id{/yun}" value="{yun:}$clist.id{/yun}" class="coupon" data-name="{yun:}$clist.coupon_name{/yun}">
                        <input type="hidden" id="{yun:}$clist.id{/yun}" value="{yun:}$clist.coupon_scope{/yun}">
                    </div>
                    {yun:}/foreach{/yun}
                </div>
            </div>
        </div>
    </div>
</div>

<!--<div id="orderpichtml" class="mui-page">
    <div class="mui-page-content">
        <div class="mui-scroll-wrapper">
            <div class="mui-scroll">
                <div class="verify">
                    <div class="photo_i_box_v">
                        <div id="orderpicshowResult">
                            <div id="orderpicchangeAvatar" class="photo_i_box">
                                <img src="{yun:}$order.order_pic{/yun}" onerror="showImgDelay(this,'{yun:}$wap_style{/yun}/images/mrewm.png',2);" width="120" height="120">
                            </div>
                            <div class="clear"></div>

                            <div class="photo_xz">
                                <input id="orderpicimage" type="file" accept="image/*" /> 上传汇款单
                            </div>
                            <div class="yunset_identity_msg"><i class="yunset_identity_msg_icon"></i>选择要上传的汇款单点击提交按钮即可上传</div>
                            <a class="yun_wap_info_brief_tit_bc mui-action-back">确定</a>
                        </div>
                        <div id="orderpicshowEdit" style="display: none;width:100%;height: 100%;position: absolute;top:0;left: 0;z-index: 9;">
                            <div style="width:100%;position: absolute;top:10px;left:0px;">
                                <button class="mui-btn" data-mui-style="fab" id='orderpiccancleBtn' style="margin-left: 10px;">取消</button>
                                <button class="mui-btn" data-mui-style="fab" data-mui-color="primary" id='orderpicconfirmBtn' style="float:right;margin-right: 10px;">确定</button>
                            </div>
                            <div id="orderpicreport"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>-->

<link rel="stylesheet" type="text/css" href="{yun:}$wap_style{/yun}/js/webapppic/cropper.css?v={yun:}$config.cachecode{/yun}" />
<script src="{yun:}$wap_style{/yun}/js/mui/mui.picker.min.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$wap_style{/yun}/js/mui/mui.view.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>

 

<script language="javascript">
    mui.init();
    var viewApi = mui('#app').view({
        defaultPage: '#main'
    });
    //初始化单页的区域滚动
    mui('.mui-scroll-wrapper').scroll();
    var view = viewApi.view;
    (function($) {
        //处理view的后退与webview后退
        var oldBack = $.back;
        $.back = function() {
            if(viewApi.canBack()) { //如果view可以后退，则执行view的后退
                viewApi.back();
            } else { //执行webview后退
                oldBack();
            }
        };
        view.addEventListener('pageBeforeBack', function(e) {
            var coupon = '',
                couponid = '';
            $('.coupon').each(function(i, arr) {
                if(arr.checked == true) {
                    coupon = arr.dataset.name;
                    couponid = arr.value;
                }
            });
            if(coupon) {
                document.getElementById('couponshow').innerText = coupon;
                document.getElementById('coupon').value = couponid;
            } else {
                document.getElementById('couponshow').innerText = '暂不使用';
                document.getElementById('coupon').value = '';
            }
        });
    })(mui);
	$(document).ready(function() {
		if(document.getElementById('main')){
			document.getElementById('main').addEventListener('touchmove', function (e) { e.preventDefault();}, {passive: false});
		}
	})
</script>
<script src="{yun:}$wap_style{/yun}/js/pay.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
{yun:}include file="$wapstyle/footer.htm"{/yun}